//#include<iostream>
//#include<algorithm>
//#include<vector>
//using namespace std;
//
////class Solution {
////public:
////    int longestOnes(const vector<int>& nums, int k) {
////        int num = 0, maxi = 0;
////        int right = 0, left = 0;
////        int n = nums.size();
////        while (right < n)
////        {
////            while (right < n && num <= k)
////            {
////                if (nums[right] == 0)
////                    num++;
////                right++;
////            }
////            maxi = max(maxi, right - left - ((nums[right - 1] == 0 && num > k) ? 1 : 0));
////            if (right < n)
////            {
////                while (num > k)
////                {
////                    if (nums[left] == 0)
////                        num--;
////                    left++;
////                }
////            }
////        }
////        return maxi;
////    }
////};
//
//class Solution {
//public:
//    int minOperations(const vector<int>& nums, int x) {
//        int maxi = 0;
//        int sum = 0;
//        for (auto i : nums)
//            sum += i;
//        sum -= x;
//        for (int left = 0, right = 0, sumtmp = 0; right < nums.size(); right++)
//        {
//            sumtmp += nums[right];
//            while (sumtmp >= sum)
//            {
//                if (sumtmp == sum)
//                    maxi = max(maxi, right - left + 1
//                    );
//                sumtmp -= nums[left++];
//            }
//        }
//        if (maxi == 0)
//            return -1;
//        else
//            return nums.size() - maxi;
//    }
//};
//
//int main()
//{
//    cout << Solution().minOperations({ 3,2,20,1,1,3 }, 10) << endl;
//    return 0;
//}